$(function () {
    //弹出层
    $(".layer-open-btn").click(function () {
        var url = $(this).attr('data-url') || '';
        var title = $(this).attr('data-title') || '设置';
        var width = $(this).attr('data-width') || '500px';
        var height = $(this).attr('data-height') || '300px';
        if(url == '') return false;
        var area_data = '';
        if(height == 'auto'){
            area_data = width;
        }else{
            area_data = [width, height];
        }
        var index = layer.open({
            type : 2,
            offset: '100px',
            title : title,
            area : area_data,
            content:url
        });
        // layer.full(index);
    });
    //关闭弹出层
    $(".layer-open-cancel").click(function () {
        var index = parent.layer.getFrameIndex(window.name);
        parent.layer.close(index);
    });
})